package jvs.vfs.tools;

import java.awt.Component;

import javax.swing.Icon;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
/**
 * 
 * @author Eric Armstrong, Tom Santos, and Steve Wilson
 *
 */
public class DirectoryRenderer extends DefaultTableCellRenderer {
	private static final long serialVersionUID = 0L;

	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {

		if (value != null && value instanceof Icon) {
			super.getTableCellRendererComponent(table, value, isSelected,
					hasFocus, row, column);
			setIcon((Icon) value);
			setText("");
			return this;
		} else {
			setIcon(null);
		}

		return super.getTableCellRendererComponent(table, value, isSelected,
				hasFocus, row, column);
	}
}
